/*
 * Copyright (c) 2018-2019 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_KERNEL_SUBSYS_BLUETOOTH_CONTROLLER_LL_SW_NORDIC_LLL_LLL_DFE_H_
#define ZEPHYR_KERNEL_SUBSYS_BLUETOOTH_CONTROLLER_LL_SW_NORDIC_LLL_LLL_DFE_H_

struct node_rx_pdu;

#if defined(CONFIG_BT_CTLR_DF_SUBSYSTEM)
/** @brief Common initialization for all DFE modes
 *
 * The function is resposnible for an initalization of common
 * part of DFE prcedure for RX and TX modes.
 */
void dfe_common_init(void);

/** @brief Get duration of DFE in microseconds
 *
 * @param u16_t	DFE duration in [us]
 */
u16_t dfe_get_duration_us();

#if defined(CONFIG_BT_CTLR_DFE_TX)
/** @brief Initialization of broadcast DFE mode.
 *
 * The function is responsible for an initialization of broadcast
 * mode of DFE.
 */
void dfe_init_adv_tx(void);
#endif /* CONFIG_BT_CTLR_DFE_TX */

#if defined(CONFIG_BT_CTLR_DFE_RX)
/** @brief Initialization of receive DFE mode.
 *
 * The function is responsible for an initialization of receive
 * mode of DFE.
 */
void dfe_init_scan_rx(void);

/** @brief Set buffer for IQ samples
 *
 * The function provides a buffer from node_rx to DFE radio module.
 * The buffer will be used by DFE in radio to store IQ samples.
 *
 * @param node_rx	pointer to a radio receive node that stores buffer for IQ samples
 */
void dfe_packet_buffer_set(struct node_rx_pdu *node_rx);

/** @brief Set header data for received IQ samples
 *
 * The function is responsible for setting header data for received
 * package of IQ samples
 *
 * @param node_rx	pointer to a radio receive node that stores DFE data header
 */
void dfe_setup_package_header(struct node_rx_pdu *node_rx);
#endif /* CONFIG_BT_CTLR_DFE_RX */
#endif /* CONFIG_BT_CTLR_DF_SUBSYSTEM */

#endif /* ZEPHYR_KERNEL_SUBSYS_BLUETOOTH_CONTROLLER_LL_SW_NORDIC_LLL_LLL_DFE_H_ */
